<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css"
	href="<%=path%>/js/themes/bootstrap/easyui.css">
<link rel="stylesheet" type="text/css" href="<%=path%>/js/themes/icon.css">
<script type="text/javascript" src="<%=path%>/js/jquery.min.js" charset="utf-8"></script>
<script type="text/javascript" src="<%=path%>/js/jquery.easyui.min.js"
	charset="utf-8"></script>
<script type="text/javascript" src="<%=path%>/js/locale/easyui-lang-zh_CN.js"
	charset="utf-8"></script>

<script type="text/javascript">
	$(function(){
		 
		var das ="";
	 	var sizes =new Array();
	 	var merges = [{
            index:0,
            rowspan:1
			          }];
		 $.ajax({
			  
	           type: "GET",
	           url:'<%=path%>/main/get/cb',
	          
			   data : {
				         "cropid":<%=session.getAttribute("cropid")%>,
				       	 "rows":$("#pageSizes").val(),
				       	 "page":$("#currPage").val()
					},
						async : false,
						success : function(data) {
							
							var data = eval('(' + data + ')');
							das=data.data.rows;
							sizes=data.data.sizes;
							total=data.total;
							console.log(total);
							
							$("#totalPages").val(total);
							$("#total").text(total);
							for(var i=0;i<sizes.length;i++){
								merges.push(sizes[i]);
							}
							
						   }

					}); 
		 
     	$('#tt').datagrid({	

			height:600,
		    data:das,
		   /*  pagination : true, */
            loadMsg: '数据加载中...',
			mode : 'remote',
			delay : 500,
		    fit:false,
		    rownumbers:true,
		   
	    	columns:[[
                {field:'lsh',title:'流水号',width:15,hidden:false},      
				{field:'date', title:'日期',width:100},
				{field:'shoushudoc',title:'手术医师',width:100},
				{field:'peitai',title:'配台医师',width:100},
				{field:'feishoushu',title:'非手术医师',width:100},
				{field:'cusname',title:'顾客姓名',width:100},
				{field:'xczx',title:'现场咨询',width:100},
				{field:'webzx',title:'网络咨询',width:100},
				{field:'phonezx',title:'电话咨询',width:100},
				{field:'scb',title:'市场部',width:100},
				{field:'menzhen',title:'门诊',width:100},
				{field:'qita',title:'其他',width:100},
				{field:'membername',title:'会员名称',width:100},
				{field:'xfdl',title:'消费大类',width:100},
				{field:'xmfl',title:'项目分类',width:100},
				{field:'xfmx',title:'消费明细',width:100},
				{field:'jfje',title:'应缴费金额',width:100},
				{field:'sjje',title:'实际消费金额',width:100},
			    {field:'zhekopulv',title:'折扣率',width:100},
				{field:'youhuijine',title:'优惠金额',width:100},
				{field:'cash',title:'现金',width:100},
				{field:'shuaka',title:'刷卡pos',width:100},
				{field:'zhipiao',title:'支票',width:100},			
				{field:'dianhui',title:'电汇',width:100},				
				{field:'qiankuan',title:'欠款',width:100},
				{field:'huaka',title:'划卡',width:100},
				{field:'yajintrans',title:'押金转入',width:100},
				{field:'sitea',title:'网站收入A',width:100},
				{field:'siteb',title:'网站收入B',width:100},
				{field:'fuka',title:'福卡',width:100},
				{field:'beiyong',title:'服务项目',width:100},
				{field:'otherpay',title:'其他付款',width:100},
				{field:'yfcrop',title:'应付公司',width:100},
				{field:'otherrecive',title:'其他应收',width:100},
				{field:'yscrop',title:'应收公司',width:100},
				{field:'yuyuedate', title:'预约金时间',width:100},
				{field:'bankadate', title:'办卡时间',width:100},
				{field:'fapiaohao',title:'发票号',width:100},
				{field:'beizhu',title:'备注',width:100},
				{field:'chukudan',title:'出库单',width:100},
				{field:'shoukuanren',title:'收款人',width:100}
				
				
				  ]],
				  
				 
				  
	 			  onLoadSuccess:function(){
	 				
	 				 var merge = merges;
	 				    
						for(var i=1; i<merges.length; i++)
						 {
							
							$('#tt').datagrid('mergeCells',{
								
								index:merge[i].index,
								field:'cash',
								rowspan:merges[i].size,
								
							});
						 }
						for(var i=1; i<merges.length; i++)
						 {
							
							$('#tt').datagrid('mergeCells',{
								
								index:merge[i].index,
								field:'shuaka',
								rowspan:merges[i].size,
								
							});
						 }
						for(var i=1; i<merges.length; i++)
						 {
							
							$('#tt').datagrid('mergeCells',{
								
								index:merge[i].index,
								field:'zhipiao',
								rowspan:merges[i].size,
								
							});
						 }for(var i=1; i<merges.length; i++)
						 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'dianhui',
									rowspan:merges[i].size,
									
								});
							 }
						 for(var i=1; i<merges.length; i++)
						 {
							
							$('#tt').datagrid('mergeCells',{
								
								index:merge[i].index,
								field:'qiankuan',
								rowspan:merges[i].size,
								
							});
						 }
						 for(var i=1; i<merges.length; i++)
						 {
							
							$('#tt').datagrid('mergeCells',{
								
								index:merge[i].index,
								field:'huaka',
								rowspan:merges[i].size,
								
							});
						 }
						 for(var i=1; i<merges.length; i++)
						 {
							
							$('#tt').datagrid('mergeCells',{
								
								index:merge[i].index,
								field:'yajintrans',
								rowspan:merges[i].size,
								
							});
						 }
						 for(var i=1; i<merges.length; i++)
						 {
							
							$('#tt').datagrid('mergeCells',{
								
								index:merge[i].index,
								field:'sitea',
								rowspan:merges[i].size,
								
							});
						 }
						 for(var i=1; i<merges.length; i++)
						 {
							
							$('#tt').datagrid('mergeCells',{
								
								index:merge[i].index,
								field:'siteb',
								rowspan:merges[i].size,
								
							});
						 }
						 for(var i=1; i<merges.length; i++)
						 {
							
							$('#tt').datagrid('mergeCells',{
								
								index:merge[i].index,
								field:'fuka',
								rowspan:merges[i].size,
								
							});
						 }
						 for(var i=1; i<merges.length; i++)
						 {
							
							$('#tt').datagrid('mergeCells',{
								
								index:merge[i].index,
								field:'otherpay',
								rowspan:merges[i].size,
								
							});
						 }
						 for(var i=1; i<merges.length; i++)
						 {
							
							$('#tt').datagrid('mergeCells',{
								
								index:merge[i].index,
								field:'otherrecive',
								rowspan:merges[i].size,
								
							});
						 }
						 for(var i=1; i<merges.length; i++)
						 {
							
							$('#tt').datagrid('mergeCells',{
								
								index:merge[i].index,
								field:'yfcrop',
								rowspan:merges[i].size,
								
							});
						 }
						 for(var i=1; i<merges.length; i++)
						 {
							
							$('#tt').datagrid('mergeCells',{
								
								index:merge[i].index,
								field:'yscrop',
								rowspan:merges[i].size,
								
							});
						 }
					} 
				  

		});	
	/* 	 //设置分页控件  
	    var p = $('#tt').datagrid('getPager');  
	    $(p).pagination({  
	        pageSize: 10,//每页显示的记录条数，默认为10  
	        pageList: [10,15,20,25],//可以设置每页记录条数的列表  
	        beforePageText: '第',//页数文本框前显示的汉字  
	        afterPageText: '页    共 {pages} 页',  
	        displayMsg: '当前显示 {from} - {to} 条记录   共 {total} 条记录',  
	    }); */
	    
	});
	</script>
<script>

//改变每页显示条数
function currentPageToOne(){		
	currPage=1;	
	
	$("#currPage").val(currPage);
	$("#currentPageNaN").text(currPage);
	var changeval=$("#pageSize  option:selected").text();
	$("#pageSizes").val(changeval);
	var das ="";
 	var sizes =new Array();
 	var merges = [{
        index:0,
        rowspan:1
		          }];
	 $.ajax({
           type: "GET",
           url:'<%=path%>/main/get/cb',
          
		   data : {
				cropid:<%=session.getAttribute("cropid")%>,
				date: $("#riqi").datebox('getValue'),
				date2:$("#riqi2").datebox('getValue'),
				cusname:$("#name").val(),
				xczx:$("#xczx").val(),
				phonezx:$("#dhzx").val(),
				webzx:$("#webzx").val(),
				scb:$("#scb").val(),
				menzhen:$("#menzhen").val(),
				qita:$("#qita").val(),
				shoushudoc:$("#shoushudoc").val(),
				peitai:$("#pt").val(),
				feishoushu:$("#feidoc").val(),
				xfdl:$("#xfdl").val(),
				xmfl:$("#xmfl").val(),
				xfmx:$("#xfmx").val(),
				zhekopulv:$("#zkl").val(),
				youhuijine:	$("#yhje").val(),
				cash:$("#cash").val(),
				shuaka:$("#pos").val(),
				zhipiao:$("#zhipiao").val(),
				dianhui:$("#dianhui").val(),
				qiankuan:$("#qiankuan").val(),
				huaka:$("#huaka").val(),
				yajintrans:$("#yajin").val(),
				sitea:$("#weba").val(),
				siteb:$("#webb").val(),
				fuka:$("#fuka").val(),
				otherpay:$("#qitafu").val(),
				otherrecive:$("#qitashou").val(),
				yuyuedate:$("#yuyue").val(),
				bankadate:$("#banka").val(),
				membername:$("#huiyuan").val(),
				fapiaohao:$("#fapiaohao").val(),
				beizhu:$("#beizhu").val(),
				chukudan:$("#chuku").val(),
				shoukuanren:$("#shoukuan").val(),
				jfje:$("#yj").val(),
				beiyong:$("#fuwu").val(),
				rows:$("#pageSizes").val(),
		       	page:$("#currPage").val()
		   },
					async : false,
					success : function(data) {
						var data = eval('(' + data + ')');
						das=data.data.rows;
						sizes=data.data.sizes;
						total=data.total;
						$("#totalPages").val(total);
						$("#total").text(total);
						for(var i=0;i<sizes.length;i++){
							merges.push(sizes[i]);
						}
						
					   }

				}); 
	 
 	$('#tt').datagrid({	
		height:600,
	    data:das,
        loadMsg: '数据加载中...',
		mode : 'remote',
		delay : 500,
	    fit:false,
	    rownumbers:true,
	   
    	columns:[[
    	        {field:'lsh',title:'流水号',width:15,hidden:false},      
  				{field:'date', title:'日期',width:100},
  				{field:'shoushudoc',title:'手术医师',width:100},
  				{field:'peitai',title:'配台医师',width:100},
  				{field:'feishoushu',title:'非手术医师',width:100},
  				{field:'cusname',title:'顾客姓名',width:100},
  				{field:'xczx',title:'现场咨询',width:100},
  				{field:'webzx',title:'网络咨询',width:100},
  				{field:'phonezx',title:'电话咨询',width:100},
  				{field:'scb',title:'市场部',width:100},
  				{field:'menzhen',title:'门诊',width:100},
  				{field:'qita',title:'其他',width:100},
  				{field:'membername',title:'会员名称',width:100},
  				{field:'xfdl',title:'消费大类',width:100},
  				{field:'xmfl',title:'项目分类',width:100},
  				{field:'xfmx',title:'消费明细',width:100},
  				{field:'jfje',title:'应缴费金额',width:100},
  				{field:'sjje',title:'实际消费金额',width:100},
  			    {field:'zhekopulv',title:'折扣率',width:100},
  				{field:'youhuijine',title:'优惠金额',width:100},
  				{field:'cash',title:'现金',width:100},
  				{field:'shuaka',title:'刷卡pos',width:100},
  				{field:'zhipiao',title:'支票',width:100},			
  				{field:'dianhui',title:'电汇',width:100},				
  				{field:'qiankuan',title:'欠款',width:100},
  				{field:'huaka',title:'划卡',width:100},
  				{field:'yajintrans',title:'押金转入',width:100},
  				{field:'sitea',title:'网站收入A',width:100},
  				{field:'siteb',title:'网站收入B',width:100},
  				{field:'fuka',title:'福卡',width:100},
  				{field:'beiyong',title:'服务项目',width:100},
  				{field:'otherpay',title:'其他付款',width:100},
  				{field:'yfcrop',title:'应付公司',width:100},
  				{field:'otherrecive',title:'其他应收',width:100},
  				{field:'yscrop',title:'应收公司',width:100},
  				{field:'yuyuedate', title:'预约金时间',width:100},
  				{field:'bankadate', title:'办卡时间',width:100},
  				{field:'fapiaohao',title:'发票号',width:100},
  				{field:'beizhu',title:'备注',width:100},
  				{field:'chukudan',title:'出库单',width:100},
  				{field:'shoukuanren',title:'收款人',width:100}
		
			  ]],
			  
			 
			  
 			  onLoadSuccess:function(){
 				
 				 var merge = merges;
 				    
					for(var i=1; i<merges.length; i++)
					 {
						
						$('#tt').datagrid('mergeCells',{
							
							index:merge[i].index,
							field:'cash',
							rowspan:merges[i].size,
							
						});
					 }
					for(var i=1; i<merges.length; i++)
					 {
						
						$('#tt').datagrid('mergeCells',{
							
							index:merge[i].index,
							field:'shuaka',
							rowspan:merges[i].size,
							
						});
					 }
					for(var i=1; i<merges.length; i++)
					 {
						
						$('#tt').datagrid('mergeCells',{
							
							index:merge[i].index,
							field:'zhipiao',
							rowspan:merges[i].size,
							
						});
					 }for(var i=1; i<merges.length; i++)
					 {
							
							$('#tt').datagrid('mergeCells',{
								
								index:merge[i].index,
								field:'dianhui',
								rowspan:merges[i].size,
								
							});
						 }
					 for(var i=1; i<merges.length; i++)
					 {
						
						$('#tt').datagrid('mergeCells',{
							
							index:merge[i].index,
							field:'qiankuan',
							rowspan:merges[i].size,
							
						});
					 }
					 for(var i=1; i<merges.length; i++)
					 {
						
						$('#tt').datagrid('mergeCells',{
							
							index:merge[i].index,
							field:'huaka',
							rowspan:merges[i].size,
							
						});
					 }
					 for(var i=1; i<merges.length; i++)
					 {
						
						$('#tt').datagrid('mergeCells',{
							
							index:merge[i].index,
							field:'yajintrans',
							rowspan:merges[i].size,
							
						});
					 }
					 for(var i=1; i<merges.length; i++)
					 {
						
						$('#tt').datagrid('mergeCells',{
							
							index:merge[i].index,
							field:'sitea',
							rowspan:merges[i].size,
							
						});
					 }
					 for(var i=1; i<merges.length; i++)
					 {
						
						$('#tt').datagrid('mergeCells',{
							
							index:merge[i].index,
							field:'siteb',
							rowspan:merges[i].size,
							
						});
					 }
					 for(var i=1; i<merges.length; i++)
					 {
						
						$('#tt').datagrid('mergeCells',{
							
							index:merge[i].index,
							field:'fuka',
							rowspan:merges[i].size,
							
						});
					 }
					 for(var i=1; i<merges.length; i++)
					 {
						
						$('#tt').datagrid('mergeCells',{
							
							index:merge[i].index,
							field:'otherpay',
							rowspan:merges[i].size,
							
						});
					 }
					 for(var i=1; i<merges.length; i++)
					 {
						
						$('#tt').datagrid('mergeCells',{
							
							index:merge[i].index,
							field:'otherrecive',
							rowspan:merges[i].size,
							
						});
					 }
					 for(var i=1; i<merges.length; i++)
					 {
						
						$('#tt').datagrid('mergeCells',{
							
							index:merge[i].index,
							field:'yfcrop',
							rowspan:merges[i].size,
							
						});
					 }
					 for(var i=1; i<merges.length; i++)
					 {
						
						$('#tt').datagrid('mergeCells',{
							
							index:merge[i].index,
							field:'yscrop',
							rowspan:merges[i].size,
							
						});
					 }
				} 
			  

	});	

}




function fenye(mark){
	//alert(mark)		
	 currPage = Number($("#currPage").val());	
     totalPages = Number($("#totalPages").val());
    
     console.log(currPage+","+totalPages);
	if(mark=="previous"){
		//jAlert("点击上一页时当前页码："+currPage);
		if(currPage ==1){	
			alert("已经是首页了！");
		}else{				
			currPage = currPage-1;
			$("#currPage").val(currPage);
			$("#currentPageNaN").text(currPage);
			var das ="";
		 	var sizes =new Array();
		 	var merges = [{
	            index:0,
	            rowspan:1
				          }];
			 $.ajax({
		           type: "GET",
		           url:'<%=path%>/main/get/cb',
		          
				   data : {
						cropid:<%=session.getAttribute("cropid")%>,
						date: $("#riqi").datebox('getValue'),
						date2:$("#riqi2").datebox('getValue'),
						cusname:$("#name").val(),
						xczx:$("#xczx").val(),
						phonezx:$("#dhzx").val(),
						webzx:$("#webzx").val(),
						scb:$("#scb").val(),
						menzhen:$("#menzhen").val(),
						qita:$("#qita").val(),
						shoushudoc:$("#shoushudoc").val(),
						peitai:$("#pt").val(),
						feishoushu:$("#feidoc").val(),
						xfdl:$("#xfdl").val(),
						xmfl:$("#xmfl").val(),
						xfmx:$("#xfmx").val(),
						zhekopulv:$("#zkl").val(),
						youhuijine:	$("#yhje").val(),
						cash:$("#cash").val(),
						shuaka:$("#pos").val(),
						zhipiao:$("#zhipiao").val(),
						dianhui:$("#dianhui").val(),
						qiankuan:$("#qiankuan").val(),
						huaka:$("#huaka").val(),
						yajintrans:$("#yajin").val(),
						sitea:$("#weba").val(),
						siteb:$("#webb").val(),
						fuka:$("#fuka").val(),
						otherpay:$("#qitafu").val(),
						otherrecive:$("#qitashou").val(),
						yuyuedate:$("#yuyue").val(),
						bankadate:$("#banka").val(),
						membername:$("#huiyuan").val(),
						fapiaohao:$("#fapiaohao").val(),
						beizhu:$("#beizhu").val(),
						chukudan:$("#chuku").val(),
						shoukuanren:$("#shoukuan").val(),
						jfje:$("#yj").val(),
						beiyong:$("#fuwu").val(),
						rows:$("#pageSizes").val(),
				       	page:$("#currPage").val()
				   },
							async : false,
							success : function(data) {
								var data = eval('(' + data + ')');
								das=data.data.rows;
								sizes=data.data.sizes;
								
								for(var i=0;i<sizes.length;i++){
									merges.push(sizes[i]);
								}
								
							   }

						}); 
			 
	     	$('#tt').datagrid({	
				height:600,
			    data:das,
	            loadMsg: '数据加载中...',
				mode : 'remote',
				delay : 500,
			    fit:false,
			    rownumbers:true,
			   
		    	columns:[[
		    	        {field:'lsh',title:'流水号',width:15,hidden:false},      
		  				{field:'date', title:'日期',width:100},
		  				{field:'shoushudoc',title:'手术医师',width:100},
		  				{field:'peitai',title:'配台医师',width:100},
		  				{field:'feishoushu',title:'非手术医师',width:100},
		  				{field:'cusname',title:'顾客姓名',width:100},
		  				{field:'xczx',title:'现场咨询',width:100},
		  				{field:'webzx',title:'网络咨询',width:100},
		  				{field:'phonezx',title:'电话咨询',width:100},
		  				{field:'scb',title:'市场部',width:100},
		  				{field:'menzhen',title:'门诊',width:100},
		  				{field:'qita',title:'其他',width:100},
		  				{field:'membername',title:'会员名称',width:100},
		  				{field:'xfdl',title:'消费大类',width:100},
		  				{field:'xmfl',title:'项目分类',width:100},
		  				{field:'xfmx',title:'消费明细',width:100},
		  				{field:'jfje',title:'应缴费金额',width:100},
		  				{field:'sjje',title:'实际消费金额',width:100},
		  			    {field:'zhekopulv',title:'折扣率',width:100},
		  				{field:'youhuijine',title:'优惠金额',width:100},
		  				{field:'cash',title:'现金',width:100},
		  				{field:'shuaka',title:'刷卡pos',width:100},
		  				{field:'zhipiao',title:'支票',width:100},			
		  				{field:'dianhui',title:'电汇',width:100},				
		  				{field:'qiankuan',title:'欠款',width:100},
		  				{field:'huaka',title:'划卡',width:100},
		  				{field:'yajintrans',title:'押金转入',width:100},
		  				{field:'sitea',title:'网站收入A',width:100},
		  				{field:'siteb',title:'网站收入B',width:100},
		  				{field:'fuka',title:'福卡',width:100},
		  				{field:'beiyong',title:'服务项目',width:100},
		  				{field:'otherpay',title:'其他付款',width:100},
		  				{field:'yfcrop',title:'应付公司',width:100},
		  				{field:'otherrecive',title:'其他应收',width:100},
		  				{field:'yscrop',title:'应收公司',width:100},
		  				{field:'yuyuedate', title:'预约金时间',width:100},
		  				{field:'bankadate', title:'办卡时间',width:100},
		  				{field:'fapiaohao',title:'发票号',width:100},
		  				{field:'beizhu',title:'备注',width:100},
		  				{field:'chukudan',title:'出库单',width:100},
		  				{field:'shoukuanren',title:'收款人',width:100}
				
					  ]],
					  
					 
					  
		 			  onLoadSuccess:function(){
		 				
		 				 var merge = merges;
		 				    
							for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'cash',
									rowspan:merges[i].size,
									
								});
							 }
							for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'shuaka',
									rowspan:merges[i].size,
									
								});
							 }
							for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'zhipiao',
									rowspan:merges[i].size,
									
								});
							 }for(var i=1; i<merges.length; i++)
							 {
									
									$('#tt').datagrid('mergeCells',{
										
										index:merge[i].index,
										field:'dianhui',
										rowspan:merges[i].size,
										
									});
								 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'qiankuan',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'huaka',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'yajintrans',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'sitea',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'siteb',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'fuka',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'otherpay',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'otherrecive',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'yfcrop',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'yscrop',
									rowspan:merges[i].size,
									
								});
							 }
						} 
					  

			});	

		}
	}else if(mark=="next"){
		if(currPage>=totalPages){
			
			alert("没有下一页！");
			$("#next").attr("disabled",true);
		}else{
			currPage = currPage+1;
			$("#currPage").val(currPage);
			$("#currentPageNaN").text(currPage);
			var das ="";
		 	var sizes =new Array();
		 	var merges = [{
	            index:0,
	            rowspan:1
				          }];
			 $.ajax({
		           type: "GET",
		           url:'<%=path%>/main/get/cb',
		          
				   data : {
						cropid:<%=session.getAttribute("cropid")%>,
						date: $("#riqi").datebox('getValue'),
						date2:$("#riqi2").datebox('getValue'),
						cusname:$("#name").val(),
						xczx:$("#xczx").val(),
						phonezx:$("#dhzx").val(),
						webzx:$("#webzx").val(),
						scb:$("#scb").val(),
						menzhen:$("#menzhen").val(),
						qita:$("#qita").val(),
						shoushudoc:$("#shoushudoc").val(),
						peitai:$("#pt").val(),
						feishoushu:$("#feidoc").val(),
						xfdl:$("#xfdl").val(),
						xmfl:$("#xmfl").val(),
						xfmx:$("#xfmx").val(),
						zhekopulv:$("#zkl").val(),
						youhuijine:	$("#yhje").val(),
						cash:$("#cash").val(),
						shuaka:$("#pos").val(),
						zhipiao:$("#zhipiao").val(),
						dianhui:$("#dianhui").val(),
						qiankuan:$("#qiankuan").val(),
						huaka:$("#huaka").val(),
						yajintrans:$("#yajin").val(),
						sitea:$("#weba").val(),
						siteb:$("#webb").val(),
						fuka:$("#fuka").val(),
						otherpay:$("#qitafu").val(),
						otherrecive:$("#qitashou").val(),
						yuyuedate:$("#yuyue").val(),
						bankadate:$("#banka").val(),
						membername:$("#huiyuan").val(),
						fapiaohao:$("#fapiaohao").val(),
						beizhu:$("#beizhu").val(),
						chukudan:$("#chuku").val(),
						shoukuanren:$("#shoukuan").val(),
						jfje:$("#yj").val(),
						beiyong:$("#fuwu").val(),
						rows:$("#pageSizes").val(),
				       	page:$("#currPage").val()
				   },
							async : false,
							success : function(data) {
								var data = eval('(' + data + ')');
								das=data.data.rows;
								sizes=data.data.sizes;
								
								for(var i=0;i<sizes.length;i++){
									merges.push(sizes[i]);
								}
								
							   }

						}); 
			 
	     	$('#tt').datagrid({	
				height:600,
			    data:das,
	            loadMsg: '数据加载中...',
				mode : 'remote',
				delay : 500,
			    fit:false,
			    rownumbers:true,
			   
		    	columns:[[
		    	        {field:'lsh',title:'流水号',width:15,hidden:false},      
		  				{field:'date', title:'日期',width:100},
		  				{field:'shoushudoc',title:'手术医师',width:100},
		  				{field:'peitai',title:'配台医师',width:100},
		  				{field:'feishoushu',title:'非手术医师',width:100},
		  				{field:'cusname',title:'顾客姓名',width:100},
		  				{field:'xczx',title:'现场咨询',width:100},
		  				{field:'webzx',title:'网络咨询',width:100},
		  				{field:'phonezx',title:'电话咨询',width:100},
		  				{field:'scb',title:'市场部',width:100},
		  				{field:'menzhen',title:'门诊',width:100},
		  				{field:'qita',title:'其他',width:100},
		  				{field:'membername',title:'会员名称',width:100},
		  				{field:'xfdl',title:'消费大类',width:100},
		  				{field:'xmfl',title:'项目分类',width:100},
		  				{field:'xfmx',title:'消费明细',width:100},
		  				{field:'jfje',title:'应缴费金额',width:100},
		  				{field:'sjje',title:'实际消费金额',width:100},
		  			    {field:'zhekopulv',title:'折扣率',width:100},
		  				{field:'youhuijine',title:'优惠金额',width:100},
		  				{field:'cash',title:'现金',width:100},
		  				{field:'shuaka',title:'刷卡pos',width:100},
		  				{field:'zhipiao',title:'支票',width:100},			
		  				{field:'dianhui',title:'电汇',width:100},				
		  				{field:'qiankuan',title:'欠款',width:100},
		  				{field:'huaka',title:'划卡',width:100},
		  				{field:'yajintrans',title:'押金转入',width:100},
		  				{field:'sitea',title:'网站收入A',width:100},
		  				{field:'siteb',title:'网站收入B',width:100},
		  				{field:'fuka',title:'福卡',width:100},
		  				{field:'beiyong',title:'服务项目',width:100},
		  				{field:'otherpay',title:'其他付款',width:100},
		  				{field:'yfcrop',title:'应付公司',width:100},
		  				{field:'otherrecive',title:'其他应收',width:100},
		  				{field:'yscrop',title:'应收公司',width:100},
		  				{field:'yuyuedate', title:'预约金时间',width:100},
		  				{field:'bankadate', title:'办卡时间',width:100},
		  				{field:'fapiaohao',title:'发票号',width:100},
		  				{field:'beizhu',title:'备注',width:100},
		  				{field:'chukudan',title:'出库单',width:100},
		  				{field:'shoukuanren',title:'收款人',width:100}
				
					  ]],
					  
					 
					  
		 			  onLoadSuccess:function(){
		 				
		 				 var merge = merges;
		 				    
							for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'cash',
									rowspan:merges[i].size,
									
								});
							 }
							for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'shuaka',
									rowspan:merges[i].size,
									
								});
							 }
							for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'zhipiao',
									rowspan:merges[i].size,
									
								});
							 }for(var i=1; i<merges.length; i++)
							 {
									
									$('#tt').datagrid('mergeCells',{
										
										index:merge[i].index,
										field:'dianhui',
										rowspan:merges[i].size,
										
									});
								 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'qiankuan',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'huaka',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'yajintrans',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'sitea',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'siteb',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'fuka',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'otherpay',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'otherrecive',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'yfcrop',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'yscrop',
									rowspan:merges[i].size,
									
								});
							 }
						} 
					  

			});	

			
			
			
		}			
	}else if(mark=="first"){
		if(currPage==1){
			$("#first").attr("disabled",true);
		}else{
			currPage=1;
			$("#currPage").val(currPage);
			$("#currentPageNaN").text(currPage);
			$("#first").attr("disabled",true);
			$("#previous").attr("disabled",true);
			var das ="";
		 	var sizes =new Array();
		 	var merges = [{
	            index:0,
	            rowspan:1
				          }];
			 $.ajax({
		           type: "GET",
		           url:'<%=path%>/main/get/cb',
		          
				   data : {
						cropid:<%=session.getAttribute("cropid")%>,
						date: $("#riqi").datebox('getValue'),
						date2:$("#riqi2").datebox('getValue'),
						cusname:$("#name").val(),
						xczx:$("#xczx").val(),
						phonezx:$("#dhzx").val(),
						webzx:$("#webzx").val(),
						scb:$("#scb").val(),
						menzhen:$("#menzhen").val(),
						qita:$("#qita").val(),
						shoushudoc:$("#shoushudoc").val(),
						peitai:$("#pt").val(),
						feishoushu:$("#feidoc").val(),
						xfdl:$("#xfdl").val(),
						xmfl:$("#xmfl").val(),
						xfmx:$("#xfmx").val(),
						zhekopulv:$("#zkl").val(),
						youhuijine:	$("#yhje").val(),
						cash:$("#cash").val(),
						shuaka:$("#pos").val(),
						zhipiao:$("#zhipiao").val(),
						dianhui:$("#dianhui").val(),
						qiankuan:$("#qiankuan").val(),
						huaka:$("#huaka").val(),
						yajintrans:$("#yajin").val(),
						sitea:$("#weba").val(),
						siteb:$("#webb").val(),
						fuka:$("#fuka").val(),
						otherpay:$("#qitafu").val(),
						otherrecive:$("#qitashou").val(),
						yuyuedate:$("#yuyue").val(),
						bankadate:$("#banka").val(),
						membername:$("#huiyuan").val(),
						fapiaohao:$("#fapiaohao").val(),
						beizhu:$("#beizhu").val(),
						chukudan:$("#chuku").val(),
						shoukuanren:$("#shoukuan").val(),
						jfje:$("#yj").val(),
						beiyong:$("#fuwu").val(),
						rows:$("#pageSizes").val(),
				       	page:$("#currPage").val()
				   },
							async : false,
							success : function(data) {
								var data = eval('(' + data + ')');
								das=data.data.rows;
								sizes=data.data.sizes;
								
								for(var i=0;i<sizes.length;i++){
									merges.push(sizes[i]);
								}
								
							   }

						}); 
			 
	     	$('#tt').datagrid({	
				height:600,
			    data:das,
	            loadMsg: '数据加载中...',
				mode : 'remote',
				delay : 500,
			    fit:false,
			    rownumbers:true,
			   
		    	columns:[[
		    	        {field:'lsh',title:'流水号',width:15,hidden:false},      
		  				{field:'date', title:'日期',width:100},
		  				{field:'shoushudoc',title:'手术医师',width:100},
		  				{field:'peitai',title:'配台医师',width:100},
		  				{field:'feishoushu',title:'非手术医师',width:100},
		  				{field:'cusname',title:'顾客姓名',width:100},
		  				{field:'xczx',title:'现场咨询',width:100},
		  				{field:'webzx',title:'网络咨询',width:100},
		  				{field:'phonezx',title:'电话咨询',width:100},
		  				{field:'scb',title:'市场部',width:100},
		  				{field:'menzhen',title:'门诊',width:100},
		  				{field:'qita',title:'其他',width:100},
		  				{field:'membername',title:'会员名称',width:100},
		  				{field:'xfdl',title:'消费大类',width:100},
		  				{field:'xmfl',title:'项目分类',width:100},
		  				{field:'xfmx',title:'消费明细',width:100},
		  				{field:'jfje',title:'应缴费金额',width:100},
		  				{field:'sjje',title:'实际消费金额',width:100},
		  			    {field:'zhekopulv',title:'折扣率',width:100},
		  				{field:'youhuijine',title:'优惠金额',width:100},
		  				{field:'cash',title:'现金',width:100},
		  				{field:'shuaka',title:'刷卡pos',width:100},
		  				{field:'zhipiao',title:'支票',width:100},			
		  				{field:'dianhui',title:'电汇',width:100},				
		  				{field:'qiankuan',title:'欠款',width:100},
		  				{field:'huaka',title:'划卡',width:100},
		  				{field:'yajintrans',title:'押金转入',width:100},
		  				{field:'sitea',title:'网站收入A',width:100},
		  				{field:'siteb',title:'网站收入B',width:100},
		  				{field:'fuka',title:'福卡',width:100},
		  				{field:'beiyong',title:'服务项目',width:100},
		  				{field:'otherpay',title:'其他付款',width:100},
		  				{field:'yfcrop',title:'应付公司',width:100},
		  				{field:'otherrecive',title:'其他应收',width:100},
		  				{field:'yscrop',title:'应收公司',width:100},
		  				{field:'yuyuedate', title:'预约金时间',width:100},
		  				{field:'bankadate', title:'办卡时间',width:100},
		  				{field:'fapiaohao',title:'发票号',width:100},
		  				{field:'beizhu',title:'备注',width:100},
		  				{field:'chukudan',title:'出库单',width:100},
		  				{field:'shoukuanren',title:'收款人',width:100}
				
					  ]],
					  
					 
					  
		 			  onLoadSuccess:function(){
		 				
		 				 var merge = merges;
		 				    
							for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'cash',
									rowspan:merges[i].size,
									
								});
							 }
							for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'shuaka',
									rowspan:merges[i].size,
									
								});
							 }
							for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'zhipiao',
									rowspan:merges[i].size,
									
								});
							 }for(var i=1; i<merges.length; i++)
							 {
									
									$('#tt').datagrid('mergeCells',{
										
										index:merge[i].index,
										field:'dianhui',
										rowspan:merges[i].size,
										
									});
								 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'qiankuan',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'huaka',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'yajintrans',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'sitea',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'siteb',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'fuka',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'otherpay',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'otherrecive',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'yfcrop',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'yscrop',
									rowspan:merges[i].size,
									
								});
							 }
						} 
					  

			});	

		}
	}else if(mark=="last"){
		if(currPage== totalPages){
			$("#last").attr("disabled",true);
				alert("已经是末页了！");
		}else{
			currPage=totalPages;
			$("#currPage").val(currPage);
			$("#currentPageNaN").text(currPage);
			$("#next").attr("disabled",true);
			$("#last").attr("disabled",true);
			var das ="";
		 	var sizes =new Array();
		 	var merges = [{
	            index:0,
	            rowspan:1
				          }];
			 $.ajax({
		           type: "GET",
		           url:'<%=path%>/main/get/cb',
		          
				   data : {
						cropid:<%=session.getAttribute("cropid")%>,
						date: $("#riqi").datebox('getValue'),
						date2:$("#riqi2").datebox('getValue'),
						cusname:$("#name").val(),
						xczx:$("#xczx").val(),
						phonezx:$("#dhzx").val(),
						webzx:$("#webzx").val(),
						scb:$("#scb").val(),
						menzhen:$("#menzhen").val(),
						qita:$("#qita").val(),
						shoushudoc:$("#shoushudoc").val(),
						peitai:$("#pt").val(),
						feishoushu:$("#feidoc").val(),
						xfdl:$("#xfdl").val(),
						xmfl:$("#xmfl").val(),
						xfmx:$("#xfmx").val(),
						zhekopulv:$("#zkl").val(),
						youhuijine:	$("#yhje").val(),
						cash:$("#cash").val(),
						shuaka:$("#pos").val(),
						zhipiao:$("#zhipiao").val(),
						dianhui:$("#dianhui").val(),
						qiankuan:$("#qiankuan").val(),
						huaka:$("#huaka").val(),
						yajintrans:$("#yajin").val(),
						sitea:$("#weba").val(),
						siteb:$("#webb").val(),
						fuka:$("#fuka").val(),
						otherpay:$("#qitafu").val(),
						otherrecive:$("#qitashou").val(),
						yuyuedate:$("#yuyue").val(),
						bankadate:$("#banka").val(),
						membername:$("#huiyuan").val(),
						fapiaohao:$("#fapiaohao").val(),
						beizhu:$("#beizhu").val(),
						chukudan:$("#chuku").val(),
						shoukuanren:$("#shoukuan").val(),
						jfje:$("#yj").val(),
						beiyong:$("#fuwu").val(),
						rows:$("#pageSizes").val(),
				       	page:$("#currPage").val()
				   },
							async : false,
							success : function(data) {
								var data = eval('(' + data + ')');
								das=data.data.rows;
								sizes=data.data.sizes;
								$("#totalPages").val(total);
								$("#total").text(total);
								for(var i=0;i<sizes.length;i++){
									merges.push(sizes[i]);
								}
								
							   }

						}); 
			 
	     	$('#tt').datagrid({	
				height:600,
			    data:das,
	            loadMsg: '数据加载中...',
				mode : 'remote',
				delay : 500,
			    fit:false,
			    rownumbers:true,
			   
		    	columns:[[
		    	        {field:'lsh',title:'流水号',width:15,hidden:false},      
		  				{field:'date', title:'日期',width:100},
		  				{field:'shoushudoc',title:'手术医师',width:100},
		  				{field:'peitai',title:'配台医师',width:100},
		  				{field:'feishoushu',title:'非手术医师',width:100},
		  				{field:'cusname',title:'顾客姓名',width:100},
		  				{field:'xczx',title:'现场咨询',width:100},
		  				{field:'webzx',title:'网络咨询',width:100},
		  				{field:'phonezx',title:'电话咨询',width:100},
		  				{field:'scb',title:'市场部',width:100},
		  				{field:'menzhen',title:'门诊',width:100},
		  				{field:'qita',title:'其他',width:100},
		  				{field:'membername',title:'会员名称',width:100},
		  				{field:'xfdl',title:'消费大类',width:100},
		  				{field:'xmfl',title:'项目分类',width:100},
		  				{field:'xfmx',title:'消费明细',width:100},
		  				{field:'jfje',title:'应缴费金额',width:100},
		  				{field:'sjje',title:'实际消费金额',width:100},
		  			    {field:'zhekopulv',title:'折扣率',width:100},
		  				{field:'youhuijine',title:'优惠金额',width:100},
		  				{field:'cash',title:'现金',width:100},
		  				{field:'shuaka',title:'刷卡pos',width:100},
		  				{field:'zhipiao',title:'支票',width:100},			
		  				{field:'dianhui',title:'电汇',width:100},				
		  				{field:'qiankuan',title:'欠款',width:100},
		  				{field:'huaka',title:'划卡',width:100},
		  				{field:'yajintrans',title:'押金转入',width:100},
		  				{field:'sitea',title:'网站收入A',width:100},
		  				{field:'siteb',title:'网站收入B',width:100},
		  				{field:'fuka',title:'福卡',width:100},
		  				{field:'beiyong',title:'服务项目',width:100},
		  				{field:'otherpay',title:'其他付款',width:100},
		  				{field:'yfcrop',title:'应付公司',width:100},
		  				{field:'otherrecive',title:'其他应收',width:100},
		  				{field:'yscrop',title:'应收公司',width:100},
		  				{field:'yuyuedate', title:'预约金时间',width:100},
		  				{field:'bankadate', title:'办卡时间',width:100},
		  				{field:'fapiaohao',title:'发票号',width:100},
		  				{field:'beizhu',title:'备注',width:100},
		  				{field:'chukudan',title:'出库单',width:100},
		  				{field:'shoukuanren',title:'收款人',width:100}
				
					  ]],
					  
					 
					  
		 			  onLoadSuccess:function(){
		 				
		 				 var merge = merges;
		 				    
							for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'cash',
									rowspan:merges[i].size,
									
								});
							 }
							for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'shuaka',
									rowspan:merges[i].size,
									
								});
							 }
							for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'zhipiao',
									rowspan:merges[i].size,
									
								});
							 }for(var i=1; i<merges.length; i++)
							 {
									
									$('#tt').datagrid('mergeCells',{
										
										index:merge[i].index,
										field:'dianhui',
										rowspan:merges[i].size,
										
									});
								 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'qiankuan',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'huaka',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'yajintrans',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'sitea',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'siteb',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'fuka',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'otherpay',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'otherrecive',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'yfcrop',
									rowspan:merges[i].size,
									
								});
							 }
							 for(var i=1; i<merges.length; i++)
							 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'yscrop',
									rowspan:merges[i].size,
									
								});
							 }
						} 
					  

			});
		}
	}
}


	function dianji(){

		var das ="";
	 	var sizes =new Array();
	 	var merges = [{
            index:0,
            rowspan:1
			          }];
		 $.ajax({
	           type: "GET",
	           url:'<%=path%>/main/get/cb',
	          
			   data : {
					cropid:<%=session.getAttribute("cropid")%>,
					date: $("#riqi").datebox('getValue'),
					date2:$("#riqi2").datebox('getValue'),
					cusname:$("#name").val(),
					xczx:$("#xczx").val(),
					phonezx:$("#dhzx").val(),
					webzx:$("#webzx").val(),
					scb:$("#scb").val(),
					menzhen:$("#menzhen").val(),
					qita:$("#qita").val(),
					shoushudoc:$("#shoushudoc").val(),
					peitai:$("#pt").val(),
					feishoushu:$("#feidoc").val(),
					xfdl:$("#xfdl").val(),
					xmfl:$("#xmfl").val(),
					xfmx:$("#xfmx").val(),
					zhekopulv:$("#zkl").val(),
					youhuijine:	$("#yhje").val(),
					cash:$("#cash").val(),
					shuaka:$("#pos").val(),
					zhipiao:$("#zhipiao").val(),
					dianhui:$("#dianhui").val(),
					qiankuan:$("#qiankuan").val(),
					huaka:$("#huaka").val(),
					yajintrans:$("#yajin").val(),
					sitea:$("#weba").val(),
					siteb:$("#webb").val(),
					fuka:$("#fuka").val(),
					otherpay:$("#qitafu").val(),
					otherrecive:$("#qitashou").val(),
					yuyuedate:$("#yuyue").val(),
					bankadate:$("#banka").val(),
					membername:$("#huiyuan").val(),
					fapiaohao:$("#fapiaohao").val(),
					beizhu:$("#beizhu").val(),
					chukudan:$("#chuku").val(),
					shoukuanren:$("#shoukuan").val(),
					jfje:$("#yj").val(),
					beiyong:$("#fuwu").val(),
					rows:$("#pageSizes").val(),
			       	page:$("#currPage").val()
			   },
						async : false,
						success : function(data) {
							var data = eval('(' + data + ')');
							das=data.data.rows;
							sizes=data.data.sizes;
							total=data.total;
							$("#totalPages").val(total);
							$("#total").text(total);
							for(var i=0;i<sizes.length;i++){
								merges.push(sizes[i]);
							}
							
						   }

					}); 
		 
     	$('#tt').datagrid({	
			height:600,
		    data:das,
		    pagination : true,
            loadMsg: '数据加载中...',
			mode : 'remote',
			delay : 500,
		    fit:false,
		    rownumbers:true,
		   
	    	columns:[[
	    	        {field:'lsh',title:'流水号',width:15,hidden:false},      
	  				{field:'date', title:'日期',width:100},
	  				{field:'shoushudoc',title:'手术医师',width:100},
	  				{field:'peitai',title:'配台医师',width:100},
	  				{field:'feishoushu',title:'非手术医师',width:100},
	  				{field:'cusname',title:'顾客姓名',width:100},
	  				{field:'xczx',title:'现场咨询',width:100},
	  				{field:'webzx',title:'网络咨询',width:100},
	  				{field:'phonezx',title:'电话咨询',width:100},
	  				{field:'scb',title:'市场部',width:100},
	  				{field:'menzhen',title:'门诊',width:100},
	  				{field:'qita',title:'其他',width:100},
	  				{field:'membername',title:'会员名称',width:100},
	  				{field:'xfdl',title:'消费大类',width:100},
	  				{field:'xmfl',title:'项目分类',width:100},
	  				{field:'xfmx',title:'消费明细',width:100},
	  				{field:'jfje',title:'应缴费金额',width:100},
	  				{field:'sjje',title:'实际消费金额',width:100},
	  			    {field:'zhekopulv',title:'折扣率',width:100},
	  				{field:'youhuijine',title:'优惠金额',width:100},
	  				{field:'cash',title:'现金',width:100},
	  				{field:'shuaka',title:'刷卡pos',width:100},
	  				{field:'zhipiao',title:'支票',width:100},			
	  				{field:'dianhui',title:'电汇',width:100},				
	  				{field:'qiankuan',title:'欠款',width:100},
	  				{field:'huaka',title:'划卡',width:100},
	  				{field:'yajintrans',title:'押金转入',width:100},
	  				{field:'sitea',title:'网站收入A',width:100},
	  				{field:'siteb',title:'网站收入B',width:100},
	  				{field:'fuka',title:'福卡',width:100},
	  				{field:'beiyong',title:'服务项目',width:100},
	  				{field:'otherpay',title:'其他付款',width:100},
	  				{field:'yfcrop',title:'应付公司',width:100},
	  				{field:'otherrecive',title:'其他应收',width:100},
	  				{field:'yscrop',title:'应收公司',width:100},
	  				{field:'yuyuedate', title:'预约金时间',width:100},
	  				{field:'bankadate', title:'办卡时间',width:100},
	  				{field:'fapiaohao',title:'发票号',width:100},
	  				{field:'beizhu',title:'备注',width:100},
	  				{field:'chukudan',title:'出库单',width:100},
	  				{field:'shoukuanren',title:'收款人',width:100}
			
				  ]],
				  
				 
				  
	 			  onLoadSuccess:function(){
	 				
	 				 var merge = merges;
	 				    
						for(var i=1; i<merges.length; i++)
						 {
							
							$('#tt').datagrid('mergeCells',{
								
								index:merge[i].index,
								field:'cash',
								rowspan:merges[i].size,
								
							});
						 }
						for(var i=1; i<merges.length; i++)
						 {
							
							$('#tt').datagrid('mergeCells',{
								
								index:merge[i].index,
								field:'shuaka',
								rowspan:merges[i].size,
								
							});
						 }
						for(var i=1; i<merges.length; i++)
						 {
							
							$('#tt').datagrid('mergeCells',{
								
								index:merge[i].index,
								field:'zhipiao',
								rowspan:merges[i].size,
								
							});
						 }for(var i=1; i<merges.length; i++)
						 {
								
								$('#tt').datagrid('mergeCells',{
									
									index:merge[i].index,
									field:'dianhui',
									rowspan:merges[i].size,
									
								});
							 }
						 for(var i=1; i<merges.length; i++)
						 {
							
							$('#tt').datagrid('mergeCells',{
								
								index:merge[i].index,
								field:'qiankuan',
								rowspan:merges[i].size,
								
							});
						 }
						 for(var i=1; i<merges.length; i++)
						 {
							
							$('#tt').datagrid('mergeCells',{
								
								index:merge[i].index,
								field:'huaka',
								rowspan:merges[i].size,
								
							});
						 }
						 for(var i=1; i<merges.length; i++)
						 {
							
							$('#tt').datagrid('mergeCells',{
								
								index:merge[i].index,
								field:'yajintrans',
								rowspan:merges[i].size,
								
							});
						 }
						 for(var i=1; i<merges.length; i++)
						 {
							
							$('#tt').datagrid('mergeCells',{
								
								index:merge[i].index,
								field:'sitea',
								rowspan:merges[i].size,
								
							});
						 }
						 for(var i=1; i<merges.length; i++)
						 {
							
							$('#tt').datagrid('mergeCells',{
								
								index:merge[i].index,
								field:'siteb',
								rowspan:merges[i].size,
								
							});
						 }
						 for(var i=1; i<merges.length; i++)
						 {
							
							$('#tt').datagrid('mergeCells',{
								
								index:merge[i].index,
								field:'fuka',
								rowspan:merges[i].size,
								
							});
						 }
						 for(var i=1; i<merges.length; i++)
						 {
							
							$('#tt').datagrid('mergeCells',{
								
								index:merge[i].index,
								field:'otherpay',
								rowspan:merges[i].size,
								
							});
						 }
						 for(var i=1; i<merges.length; i++)
						 {
							
							$('#tt').datagrid('mergeCells',{
								
								index:merge[i].index,
								field:'otherrecive',
								rowspan:merges[i].size,
								
							});
						 }
						 for(var i=1; i<merges.length; i++)
						 {
							
							$('#tt').datagrid('mergeCells',{
								
								index:merge[i].index,
								field:'yfcrop',
								rowspan:merges[i].size,
								
							});
						 }
						 for(var i=1; i<merges.length; i++)
						 {
							
							$('#tt').datagrid('mergeCells',{
								
								index:merge[i].index,
								field:'yscrop',
								rowspan:merges[i].size,
								
							});
						 }
					} 
				  

		});	

	    
	}
</script>
<script type="text/javascript">
    function create(){
 	 
 	  var rows=  $('#tt').datagrid('getChecked');
 	  var params="";
 	  
 	  $.each(rows, function(index, row){
 	
 		  params+=row.lsh+",";
 			});
 	  
 	     $.ajax({
 		           type: "POST",
 		           url:"<%=path%>/main/create/excel",
 				   data : {
 	   		       "cropid":<%=session.getAttribute("cropid")%>,
 				   "params":params,
 	   				 },
 					async : false,
 					success : function(data) {
 					console.log(data);
 					var data = eval('(' + data + ')');
 					var num = data.data.status;
 					console.log(num);
 					if (num == 0) {
 	                  $.messager.alert("","成功创建excle");
 	                     
 					 }
 					if (num == 1) {
 	 	                  $.messager.alert("","再试一次吧!");
 	 	                     
 	 					 }

 				}
 		}); 
    }
  

</script>
<style>
#d1 {
	text-align: center;
}

#d3 {
	width: 100%;
	margin: 45px auto;
}
#searchform table td{ word-break:break-all; padding:5px 0;}
</style>
<title>Insert title here</title>
</head>
<body>
	<div id="d1">
		<h2>公司台账</h2>
	</div>

	<div id="dd2">
			<form id="searchform">
				<table style="width:100%" cellspading="0" cellpadding="0" border="0">
					
					<tr>
						<th width="10%">顾客姓名</th>
						<td width="10%"><input id="name" type="text"/></td>
						<th width="10%">现场咨询</th>
						<td width="10%"><input id="xczx" type="text"/></td>
						<th width="10%">电话咨询</th>
						<td width="10%"><input id="dhzx" type="text"/></td>
						<th width="10%">网络咨询</th>
						<td width="10%"><input id="webzx" type="text"/></td>
						<th width="10%">应缴费金额</th>
						<td width="10%"><input id="yj" type="text"/></td>
					</tr>
					<tr>
						
						<th>市场部</th>
						<td><input id="scb" type="text"/></td>
						<th>门诊部</th>
						<td><input id="menzhen" type="text"/></td>
						<th>其他</th>
						<td><input id="qita" type="text"/></td>
						<th>手术医师</th>
						<td><input id="shoushudoc" type="text"/></td>
						<th>配台医师</th>
						<td><input id="pt" type="text"/></td>
						
					</tr>
					<tr>
						<th>非手术医师</th>
						<td><input id="feidoc" type="text"/></td>
						<th>消费大类</th>
						<td><input id="xfdl" type="text"/></td>
						<th>项目分类</th>
						<td><input id="xmfl" type="text"/></td>
						<th>消费明细</th>
						<td><input id="xfmx" type="text"/></td>
						<th>折扣率</th>
   						<td><input id="zkl" type="text" /></td>
					</tr>

                  <tr>
                    <th>优惠金额</th>
   					<td><input id="yhje" type="text" /></td>
   					<th>现金</th>
   					<td><input id="cash" type="text" /></td>
   					<th>POS刷卡</th>
   					<td><input id="pos" type="text" /></td>
   					<th>支票</th>
   					<td><input id="zhipiao" type="text" /></td>
   					<th>电汇</th>
   					<td><input id="dianhui" type="text" /></td>
   				  </tr>
   				  <tr>
   				  	<th>欠款</th>
   					<td><input id="qiankuan" type="text" /></td>
   					<th>划卡</th>
   					<td><input id="huaka" type="text" /></td>
   					<th>押金转入</th>
   					<td><input id="yajin" type="text" /></td>
   					<th>网站收入(A)</th>
   					<td><input id="weba" type="text" /></td>
   					<th>网站收入(B)</th>
   					<td><input id="webb" type="text" /></td>
   				 </tr>
   				 <tr>
   				    <th>福卡</th>
   					<td><input id="fuka" type="text" /></td>
   					<th>其他付款</th>
   					<td><input id="qitafu" type="text" /></td>
   					<th>其他应收</th>
   					<td><input id="qitashou" type="text" /></td>
   					<th>预约金时间</th>
   					<td><input id="yuyue" type="text" class="easyui-datebox" /></td>
   					<th>办卡时间</th>
   					<td><input id="banka" type="text" class="easyui-datebox" /></td>
   				</tr>
   				<tr>
   				    <th>会员名称</th>
   					<td><input id="huiyuan" type="text" /></td>	
   					<th>发票号</th>
   					<td><input id="fapiaohao" type="text" /></td>
   					<th>备注</th>
   					<td><input id="beizhu" type="text" /></td>
   					<th>出库单</th>
   					<td><input id="chuku" type="text" /></td>
   					<th>收款人</th>
   					<td><input id="shoukuan" type="text" /></td>
   					
   				</tr>
				<tr>
					<th>日期</th>
					<td colspan="3"><input id="riqi" type="text" class="easyui-datebox"/>至<input id="riqi2" type="text" class="easyui-datebox"/></td>
					<th>服务项目</th>
  						<td colspan="6"><input id="fuwu" type="text" /></td>
				</tr>
					
				</table>
			</form>
	</div>

	<div id="d3">
	    <input type="button" id="excel" value="生成excel" onclick="create()">
		<input type="button" id="asd" value="查询" onclick="dianji()">
		<table id="tt">

		</table>
		
	</div>
<div class="deppagelist">
       <div id="pageList"  class="ye">
    
    	<ul>
			<li class="page nopage">
				<select id="pageSize" name="store" onchange="currentPageToOne();">
					<option value="10" selected>10</option>	
					<option value="20">20</option>
					<option value="30">30</option>
					<option value="50">50</option>
					<option value="100">100</option>			
				</select>
            </li>
			<li class="page"><a href="#gotop" id="first" onclick="fenye('first')">首页</a></li>     
        	<li class="page"><a href="#gotop" id="previous" onclick="fenye('previous')">上一页</a></li>
            <li>	
            		<input name="pageSizes" id="pageSizes" value="10"/>
					<input name = "currPage" id ="currPage" value="1" type="hidden">当前页:<label id="currentPageNaN" >1</label>
					<input name = "totalPages" id ="totalPages" value="" type="hidden">共<label id="total" ></label>页								
			</li>
            <li class="page"><a href="#gotop" id="next" onclick="fenye('next')">下一页</a></li>
            <li class="page"><a href="#gotop" id="last" onclick="fenye('last')">尾页</a></li>
         
        </ul>
	 <!--  </script> -->
    </div>
 </div>

</body>
</html>